From: Georges Basile Stavracas Neto Date: Thu, 13 Aug 2020 20:58:51 +0000 (-0300) Subject: iconGrid: Properly remove pages X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~31 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f541562acc3c5c8845d30692daafe4063d805ff5;p=gnome-shell.git iconGrid: Properly remove pages When the last item of an IconGridLayout page is removed, the page itself is removed too. However, the indexes of items of next pages are not updated, which mess up the layout manager state. Update the page index of the items at forward pages when removing a page. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1406 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 2d3a17a62..12a4aed9b 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -468,6 +468,12 @@ var IconGridLayout = GObject.registerClass({ this._unlinkItem(item); }); + // Adjust the page indexes of items after this page + for (const itemData of this._items.values()) { + if (itemData.pageIndex > pageIndex) + itemData.pageIndex--; + } + this._pages.splice(pageIndex, 1); this.emit('pages-changed'); }